# -*- coding: utf-8 -*-
"""
@Project ：weather 
@File    ：weather_constants.py
@Author: guzain
@Date:  2025/7/7 11:32:29
@Email： GZA5210@163.com
@Description: 天气服务常量定义
"""
import datetime
import time
import pytz
from config.config import WEATHER_KEY, TIANAPI_KEY

# 日期和时间相关常量
DATE_TOMORROW = (datetime.datetime.now() + datetime.timedelta(days=1)).strftime("%Y-%m-%d")
cur_time = time.time()
local_tz = pytz.timezone("Asia/Shanghai")
local_time = datetime.datetime.fromtimestamp(cur_time, tz=local_tz).hour

# API相关常量
DEFAULT_CITY_ID = "101010100"  # 默认城市ID（北京）
WEATHER_API_BASE_URL = "https://devapi.qweather.com/v7"  # 和风天气API基础URL
IPINFO_API_URL = "https://ipinfo.io/json"  # IP信息API URL
TIANAPI_IPQUERY_URL = "https://apis.tianapi.com/ipquery/index"  # 天眼查IP查询API URL

# 天气类型相关常量
RAIN_TYPES = ['大雨', '中雨', '雷阵雨', '暴雨', '大暴雨', '特大暴雨']

def get_clean_weather_key():
    """获取清理后的天气API密钥"""
    return WEATHER_KEY.strip("'\"").strip()
